home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-16 | 2.7 KB | 83 lines | [TEXT/MPS ] |
- #----------------------------------------------------------------------------------------------------------------------------------------------------
- # MyPrint
- # MPW Shell Script
- # Written by Gina Cherry • August 16, 1991
- # Copyright: © 1991 by Apple Computer, Inc., all rights reserved.
- #
- # Usage: MyPrint files… -ps file
- #
- # Function:
- # MyPrint prints one or more files specified on the command line, and a PostScript file,
- # which it sends to the LaserWriter prior to printing each page. A sample PostScript file
- # is included in this package. MyPrint prompts the user to make sure that background
- # printing is turned off, since background printing must be turned off in order to print a
- # PostScript file from MPW.
- #----------------------------------------------------------------------------------------------------------------------------------------------------
-
- # Initialize variables.
- Set fileList ""
- Set PSFile ""
-
- # Don't exit on error.
- Set Exit 0
-
- # Loop through parameters.
- Loop
-
- # Break if no more parameters.
- Break If "{1}" == ""
-
- # If current parameter is -ps, get next parameter and set PSFile to it.
- If "{1}" == '-ps'
- Shift 1
- # Make sure a PostScript file was specified.
- If "{1}"
- # Make sure ps option was not given more than once.
- If {PSFile} == ""
- Set PSFile "{1}"
- Else
- Echo "### {0}: Option ∂"-ps∂" multiply defined."
- Echo "### Usage: {0} files… -ps file"
- Exit 1
- End
- Else
- Echo "### {0}: Must specify a PostScript file."
- Echo "### Usage: {0} files… -ps file"
- Exit 1
- End >> Dev:StdErr
-
- # Otherwise, add the current parameter to the file list.
- Else
- Set fileList "{fileList} '{1}'"
- End
-
- # Get next parameter.
- Shift 1
- End
-
- # If no files in file list, write error message and exit script.
- If "{fileList}" == ""
- Echo "### {0}: No files to print."
- Echo "### Usage: {0} files… -ps file"
- Exit 1
- End >> Dev:StdErr
-
- # If no PostScript file was specified, write error message and exit script.
- If "{PSFile}" == ""
- Echo "### {0}: No PostScript file given."
- Echo "### Usage: {0} files… -ps file"
- Exit 1
- End >> Dev:StdErr
-
- # Make sure background printing is turned off
- Confirm "Proceed only if background printing is off."
-
- # Exit script if Cancel was chosen.
- Exit If {Status} != 0
-
- # Print files in file list using print options specified below, with the specified PostScript file in
- # the background. In this example, all files will be printed in 10 point Monaco, and with a header.
- # Change these commands to conform to your printing preferences.For information on other print
- # options see the MPW Command Reference.
- Print {fileList} -font Monaco -size 10 -h -ps "{PSFile}"
-